<%@ page language="java" import="java.util.*,com.knife.member.*" pageEncoding="UTF-8"%>
<%
request.setCharacterEncoding("UTF-8");
String msg="";
String parameter="";
if(request.getParameter("parameter")!=null){
	parameter=request.getParameter("parameter");
}
int id=0;
if(request.getParameter("id")!=null){
	id = Integer.parseInt(request.getParameter("id"));
}
String type = "";
if(request.getParameter("type")!=null){
	type = request.getParameter("type");
}

Organization adoct = new Organization();
OrganizationDAO doctDAO = new OrganizationDAO();
if(id>0){
	adoct=doctDAO.findById(id);
}
if(parameter.equals("delete")){
	doctDAO.delete(adoct);
	msg="删除成功！";
}else{
	adoct.setType(type);
	adoct.setClassid(0);
	try{
		doctDAO.save(adoct);
		msg="编辑成功！";
	}catch(Exception e){
		e.printStackTrace();
		msg="编辑失败！";
	}
}
%>
<script language="javascript">
alert("<%=msg%>");
history.back(-1);
</script>